package com.campus.service.impl;

import com.campus.entity.TManagerStudent;
import com.campus.mapper.StudentMapper;
import com.campus.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public int createStudent(Integer id, String stuName, String fromPlace, String parentPhone, String currentGrade, Integer loginId, Integer classId) {
        TManagerStudent tManagerStudent = new TManagerStudent();
        tManagerStudent.setCurrentGrade(currentGrade);
        tManagerStudent.setFromPlace(fromPlace);
        tManagerStudent.setId(id);
        tManagerStudent.setLoginId(loginId);
        tManagerStudent.setStuName(stuName);
        tManagerStudent.setClassId(classId);
        tManagerStudent.setParentPhone(parentPhone);

        return studentMapper.createStudent(tManagerStudent);
    }

    @Override
    public int createStudents(List<TManagerStudent> studentList) {
        return studentMapper.createStudents(studentList);
    }
}
